# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgname=python-restkit
_pkgname=restkit
pkgver=4.2.2
pkgrel=9
pkgdesc='Python REST kit.'
url='https://pypi.org/project/restkit/#files'
arch=('any')
license=('MIT')
depends=('python' 'python-http-parser' 'python-socketpool')
makedepends=('python-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('5ed08535e1a54b5594d97b059d8662ab4bc19c68e71a30719c4a533cba0f2d0e18872119752c62136563a32281e8f747414fbf843fd97dba138107ffcb5d1e4b')

build() {
  cd "$_pkgname-$pkgver"

  python setup.py build
}

package() {
  cd "$_pkgname-$pkgver"

  python setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build

  mv "$pkgdir/usr/bin/restcli" "$pkgdir/usr/bin/restcli3"

  rm -rf "$pkgdir/usr/$_pkgname"
}

